﻿using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace CL_VisionCommu_Test.Helper
{
    public class MultiParameterCommand<T>: ICommand
    {
        public event EventHandler CanExecuteChanged;

        public Action<T> Action { get; }

        public MultiParameterCommand(Action<T> action)
        {
            Action=action;
        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public void Execute(object parameter)
        {
            Action?.Invoke((T)parameter);
        }
    }
}
